package com.guavause.forwarding;

import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import org.junit.Test;

import java.util.List;

/**
 * @author kxd
 * @date 2018/12/3 18:20
 * description:
 */
public class PeekingIteratorTest {

    @Test
    public void test(){
     /*   List result= Lists.newArrayList();
        PeekingIterator<E> iter = Iterators.peekingIterator(source.iterator());
        while (iter.hasNext()) {
            E current = iter.next();
            while (iter.hasNext() && iter.peek().equals(current)) {
                // skip this duplicate element
                iter.next();
            }
            result.add(current);
        }*/
    }
}
